//
//  TradeDetailItemVM.swift
//  kxf
//
//  Created by LNS2 on 2024/4/24.
//

import Foundation
import UIKit

class TradeDetailItemVM: UIView {
    
    let selfHeight = kFitWidth(48)
    
    override init(frame:CGRect){
        super.init(frame: CGRect.init(x: 0, y: frame.origin.y, width: SCREEN_WIDHT, height: selfHeight))
        self.backgroundColor = .white
        
        initUI()
    }
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    lazy var titleLabel : UILabel = {
        let lab = UILabel()
        lab.textColor = .COLOR_TEXT_BLACK666
        lab.font = .systemFont(ofSize: 16, weight: .regular)
        
        return lab
    }()
    lazy var rightLabel : UILabel = {
        let lab = UILabel()
        lab.textColor = .COLOR_TEXT_BLACK666
        lab.font = .systemFont(ofSize: 16, weight: .regular)
        lab.numberOfLines = 2
        lab.adjustsFontSizeToFitWidth = true
        lab.lineBreakMode = .byWordWrapping
        lab.textAlignment = .right
        
        return lab
    }()
}

extension TradeDetailItemVM{
    func initUI() {
        addSubview(titleLabel)
        addSubview(rightLabel)
        
        setConstrait()
    }
    func setConstrait() {
        titleLabel.snp.makeConstraints { make in
            make.left.equalTo(kFitWidth(12))
            make.centerY.lessThanOrEqualToSuperview()
        }
        rightLabel.snp.makeConstraints { make in
            make.right.equalTo(kFitWidth(-12))
            make.width.equalTo(kFitWidth(260))
            make.centerY.lessThanOrEqualToSuperview()
        }
    }
}
